drm/vc4: Fix OOPSes from trying to cache a partially constructed BO.
authorEric Anholt <eric@anholt.net>
Thu, 9 Feb 2017 17:23:34 +0000 (09:23 -0800)
committerRaspbian kernel package updater <root@raspbian.org>
Thu, 15 Feb 2018 17:28:54 +0000 (17:28 +0000)
commitc3d9aba3d3d7482dec144b2594f73d266b890c59
treeec182020731c254f2784866e44361631eef09dee
parent34d175019497539ffdb5a466439ecd41ef42b86b
drm/vc4: Fix OOPSes from trying to cache a partially constructed BO.

If a CMA allocation failed, the partially constructed BO would be
unreferenced through the normal path, and we might choose to put it in
the BO cache.  If we then reused it before it expired from the cache,
the kernel would OOPS.

Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: c826a6e10644 ("drm/vc4: Add a BO cache.")
drivers/gpu/drm/vc4/vc4_bo.c